public class Course {
    // 私有属性（封装核心）
    private String courseId;    // 课程编号
    private String courseName;  // 课程名称
    private String teacher;     // 任课教师

    // 1. 无参构造方法
    public Course() {
    }

    // 2. 带参构造方法（初始化所有属性）
    public Course(String courseId, String courseName, String teacher) {
        this.courseId = courseId;
        this.courseName = courseName;
        this.teacher = teacher;
    }

    // 3. Getter 方法
    public String getCourseId() {
        return courseId;
    }

    public String getCourseName() {
        return courseName;
    }

    public String getTeacher() {
        return teacher;
    }

    // 4. Setter 方法
    public void setCourseId(String courseId) {
        this.courseId = courseId;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public void setTeacher(String teacher) {
        this.teacher = teacher;
    }

    // 5. 展示课程信息的方法
    public void showInfo() {
        System.out.println("课程编号：" + courseId);
        System.out.println("课程名称：" + courseName);
        System.out.println("任课教师：" + teacher);
        System.out.println("-----------------"); // 分隔线，提升可读性
    }
}